<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Models\User;
use Faker\Generator as Faker;

// 生成模拟数据的工厂模式
$factory->define(User::class, function (Faker $faker) {
    return [
        'username' => $faker->userName,
        'truename' => $faker->name,
        'password' => bcrypt('nalipao'),
        'email'    => $faker->email,
        'phone'    => $faker->phoneNumber,
        'gender'   => ['先生', '女士'][rand(0, 1)],
        'last_ip' => $faker->ipv4,
    ];

});
